#include<bits/stdc++.h>
using namespace std;

int a[100010];

int main()
{
	int m, n, k;
	cin>>n>>m>>k;
	for(int i = 1;i <= n;i++)
		cin>>a[i];
		
	int cnt = 0, r = 1;
	int ans = 0;
	
	for(int i = 1;i <= n;)
	{
		if(a[i] <= k)
			cnt++;
		else
			cnt = 0;
		r = i+1;
		if(cnt == m)
		{
			ans++;
			while(a[r] <= k && r <= n)
				r++, ans++;
		}
		i = r;
	}
	cout<<ans;
	return 0;
}

